<template>
  <q-dialog v-model="dialogShow">
    <div class="full-width relative-position" style="max-width: 300px">
      <div class="flex justify-center">
        <img src="~/assets/images/mechanism/card-top.png" style="width: 65px" class="block" />
      </div>
      <div
        class="q-px-md q-pb-lg"
        style="
          margin-top: -35px;
          padding-top: 40px;
          border-radius: 12px;
          background: linear-gradient(180deg, #b2d0ff 0%, #ffffff 100%);
        "
      >
        <div class="q-mt-sm" style="color: #0a225c; text-align: center; font-weight: 600; font-size: 18px">
          <span style="color: #096aff">恭喜你！</span>成功匹配机构
        </div>

        <q-btn
          unelevated
          rounded
          @click="submit"
          padding="xs"
          class="full-width q-mt-lg btn"
          style="background: #096aff; color: #fff; font-weight: bold; letter-spacing: 1px; font-size: 16px"
        >
          <span class="q-py-xs">点击立即查看</span>
          <div class="pointer">
            <img src="~/assets/images/public/pointer.png" style="display: block; width: 45px" />
          </div>
        </q-btn>
      </div>
    </div>
  </q-dialog>
</template>

<script setup lang="ts">
import { ref } from 'vue';

const emit = defineEmits(['submit']);

const dialogShow = ref(false);

const show = () => {
  dialogShow.value = true;
};

const submit = () => {
  dialogShow.value = false;
  emit('submit');
};

defineExpose({ show });
</script>

<style lang="scss" scoped>
.btn {
  position: relative;
  .pointer {
    position: absolute;
    right: calc(15% - 22px);
    top: 42%;
    animation: scalean 2s infinite;
  }
}

@keyframes scalean {
  0% {
    transform: scale(1);
  }

  25% {
    transform: scale(1.14);
  }

  50% {
    transform: scale(1);
  }
  75% {
    transform: scale(1.14);
  }
}
</style>
